home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 7
/
Amiga Format AFCD07 (Dec 1996, Issue 91).iso
/
serious
/
shareware
/
comms
/
non-internet
/
samba
/
bin
/
smbtar
< prev
next >
Wrap
Text File
|
1996-06-26
|
1KB
|
88 lines
#!/bin/sh
#
# edit this to show where your smbclient is
SMBCLIENT="./smbclient"
server=""
service=backup
password=""
username=$LOGNAME
verbose="/dev/null"
log="-d 2"
newer=""
blocksize=""
tarcmd="tar c"
TF=${TAPE-tar.out}
USAGE=$0" [ -pxut ] -s server\n
-p password\n
-x service\n
-n newer\n
-i incremental\n
-b blocksize\n
-r restore\n
-l log\n
-u user\n
-r restore\n
-t tape"
while getopts ril:b:n:vs:p:x:u:t: c; do
case $c in
r) tarcmd="tar x"
;;
i) incremental="tarmode inc reset"
;;
l) log="-d $OPTARG"
;;
n) if [ -f $OPTARG ]; then
newer="newer $OPTARG"
else
echo $0: Warning, $OPTARG not found
fi
;;
s) server=$OPTARG
;;
b) blocksize="blocksize $OPTARG"
;;
p) password=$OPTARG
;;
x) service=$OPTARG
;;
t) TF=$OPTARG
;;
u) username=$OPTARG
;;
v) verbose="/dev/tty"
;;
\?) echo $USAGE
exit 2
;;
esac
done
shift `expr $OPTIND - 1`
if [ $service = "" ]; then
echo $USAGE
exit 1
fi
if [ -n $verbose ]; then
echo server is $server
echo service is $service
echo tar cmd is $tarcmd
echo password is $password
echo share is $service
echo tape is $TF
fi
(
echo "lowercase"
echo $newer
echo $blocksize
echo $incremental
echo $tarcmd $TF
) | $SMBCLIENT "\\\\$server\\$service" $password -U $username -N $log > $verbose